<template>
<div class="localindex">
  <!-- 标题 -->
    <!-- <h1 class="title">{{ msg }}</h1> -->
    <Row class="titlebar">
      <Button type="primary" size="small" class="search-btn-l" v-show="islog" @click="userLogin">登录</Button>
      <Button type="primary" size="small" class="search-btn-l" v-show="islogin"  @click="getshopcar">购物车</Button>
      <Button type="primary" size="small" class="search-btn-l" v-show="islogin"  @click="userlogout">退出</Button>
      <Button type="primary" size="small" class="search-btn-l" v-show="islogin" @click="personCenterOrder">我的订单</Button>
      <Button type="primary" size="small" class="search-btn-l" v-show="islogin" @click="personCenterStandard">我的标准</Button>
      <Button type="primary" size="small" class="search-btn-l" v-show="islogin" @click="personCenter">{{username}}</Button>
      <Button type="primary" size="small" class="search-btn-l" v-show="islog" @click="userLogin">注册</Button>
      <Button type="primary" size="small" class="search-btn-l" @click="homepage">首页</Button>
    </Row>
    <Row>
        <i-col span="3">
          <p>&#12288;</p>
        </i-col>
        <i-col span="3">
         <div class="titlebimg"></div>
        </i-col>
        <i-col span="18">
          <h1 class="title">{{ msg }}</h1>
          <h1 class="titleyin">Free publication of food standards</h1>
        </i-col>
    </Row>
    <!-- 导航栏 -->
    <Row class="indexhh">
      <i-col class="indexdh" span="24">
        <!-- <a class="htitle" href="#" @click="toindex">首页</a> -->
        <a class="htitle" href="/" >首页</a>
        <a class="htitle" href="#" @click="tonewslist">新闻动态</a>
        <a class="htitle" href="#" @click="tonoticelist">通知公告</a>
        <a class="htitle" href="#" @click="nationstandard">国家标准</a>
        <a class="htitle" href="#" @click="localstandard">地方标准</a>
        <a class="htitle" href="#" @click="seniorsearch">行业标准</a>
        <a class="htitle" href="#" @click="seniorsearch">团体标准</a>
        <a class="htitle" href="#" @click="bookstore">标准书店</a>
        <a class="htitle" href="#" @click="projectlist">项目研究</a>
        <a class="htitle" href="#" @click="knowledge">知识库</a>
        <a class="htitle" href="#" @click="aboutus">关于我们</a>
      </i-col>
    </Row>
</div>
</template>

<script>
export default {
  name: 'seniorsearch',
  data () {
    return {
      msg: '食品标准查询',
      userinfo: '',
      islogin: false,
      islog: true,
      username: ''
    }
  },
  methods: {
    // 返回首页
    toindex () {
      let routeUrl = this.$router.resolve({
        path: '/'
      })
      window.open(routeUrl.href, '_self')
    },
    // 新闻列表页面跳转
    tonewslist () {
      let routeUrl = this.$router.resolve({
        path: '/newlist'
      })
      window.open(routeUrl.href, '_self')
    },
    // 通知公告列表页面跳转
    tonoticelist () {
      let routeUrl = this.$router.resolve({
        path: '/noticelist'
      })
      window.open(routeUrl.href, '_self')
    },
    // 登录
    userLogin () {
      let routeUrl = this.$router.resolve({
        path: '/login'
      })
      window.open(routeUrl.href, '_self')
    },
    // 登录
    getshopcar () {
      let routeUrl = this.$router.resolve({
        path: '/shopcar'
      })
      window.open(routeUrl.href, '_self')
    },
    // 我的订单
    personCenterOrder () {
      let routeUrl = this.$router.resolve({
        path: '/userorders'
      })
      window.open(routeUrl.href, '_self')
    },
    // 我的标准
    personCenterStandard () {
      let routeUrl = this.$router.resolve({
        path: '/purchasedstandard'
      })
      window.open(routeUrl.href, '_self')
    },
    // 个人中心
    personCenter () {
      let routeUrl = this.$router.resolve({
        path: '/userinfo'
      })
      window.open(routeUrl.href, '_self')
    },
    userlogout () {
      this.$cookie.delete('user')
      let routeUrl = this.$router.resolve({
        path: '/'
      })
      window.open(routeUrl.href)
    },
    homepage () {
      let routeUrl = this.$router.resolve({
        path: '/'
      })
      window.open(routeUrl.href, '_self')
    },
    seniorsearch () {
      let routeUrl = this.$router.resolve({
        path: '/seniorsearch'
      })
      window.open(routeUrl.href, '_self')
    },
    bookstore () {
      let routeUrl = this.$router.resolve({
        path: '/bookstore'
      })
      window.open(routeUrl.href, '_self')
    },
    localstandard () {
      let routeUrl = this.$router.resolve({
        path: '/localstand'
      })
      window.open(routeUrl.href, '_self')
    },
    nationstandard () {
      let routeUrl = this.$router.resolve({
        path: '/nationstandard'
      })
      window.open(routeUrl.href, '_self')
    },
    projectlist () {
      // let routeUrl = this.$router.resolve({
      //   path: '/projectlist'
      // })
      // window.open(routeUrl.href, '_blank')
      window.open('https://www.nmgzby.ac.cn/yjcg.jhtml', '_blank')
    },
    aboutus () {
      let routeUrl = this.$router.resolve({
        path: '/aboutus'
      })
      window.open(routeUrl.href, '_self')
    },
    // 知识库
    knowledge () {
      // window.open('http://www.nmgbzy.org.cn/yjcg.jhtml', '_blank')
      let routeUrl = this.$router.resolve({
        path: '/knowledgelist'
      })
      window.open(routeUrl.href, '_self')
    }
  },
  created () {
    // this.model1 = this.cityList[0].value
    this.userinfo = this.$cookie.get('user')
    this.userinfo = JSON.parse(this.userinfo)
    // 已登录
    if (this.userinfo != null) {
      this.islogin = true
      this.islog = false
      this.username = this.userinfo.realName
    }
  }
}
</script>

<style scoped>
    /* 首页头部图片 */
.titlebimg{
    background-image: url(../assets/img/indextitle.png);
    background-repeat: no-repeat;
    background-size:100% 100%;
    width:170px;
    height:170px;
}

/* 导航菜单样式 */
.ivu-menu-light{
   /* background-color: rgba(118,156,231,0.5); */
   background-color: #90a0dd;
   /* #769ce7 */
}

.ivu-menu-horizontal{
    margin-top: 20px;
    height: 35px;
    line-height: 35px;
    text-align: center;
}

.title{
   font-size:3.2em;
   color:#fff;
   padding-top: 4%;
   padding-left: 4%;
   text-shadow:2px 2px 4px #000;
   letter-spacing:12px
   /*字体边框颜色 #0F186D */
}

.titleyin{
    font-size:2em;
    color:#fff;
    padding-top: 0%;
    padding-left: 4%;
    text-shadow:2px 2px 4px #000;
    /*字体边框颜色 #0F186D */
}

.indexhh{
    margin-top: 20px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    background-color: #0267a4;
    box-shadow:1px 1px 4px #285da1;
}

/* 顶部导航栏 */
.indexdh{
    text-align: center;
}

.htitle{
    font-size: 16px;
    margin-left: 2%;
    margin-right: 2%;
}

a {
    color: #fff;
    background: 0 0;
    text-decoration: none;
    outline: 0;
    cursor: pointer;
    transition: color .2s ease;
}

a:hover{
    color: #f2ab35;
}

.search-btn-l{
    margin-top: 2px;
    float: right;
    margin-right: 10px;
    margin-bottom: 2px;
    color:#fff;
    font-size: 12px;
}

.titlebar{
  background-color:rgba(0, 95, 171, 0.32);
}

.localindex{
    /* background-image: url(../assets/img/shibiebg.jpg);
    background-repeat: no-repeat;
    background-size: cover; */
}
</style>
